<?php
use \Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

//后台路由
Route::group(['prefix' => 'Admin','namespace'=>'Admin','middleware'=>['auth','checkpermission']], function() {
    //首页
    Route::get('/', 'IndexController@index')->name('admin.index.index');
    Route::get('Index', 'IndexController@index')->name('admin.index.index');
    Route::get('Index/index', 'IndexController@index')->name('admin.index.index');
    Route::get('Index/dashboard', 'IndexController@dashboard')->name('admin.index.dashboard');
    Route::get('Index/sysinfo', 'IndexController@sysinfo')->name('admin.index.sysinfo');
    Route::get('Index/skinConfig', 'IndexController@skinconfig')->name('admin.index.skinconfig');
    //菜单分组管理
    Route::get('SysMenuGroup/index', 'SysMenuGroupController@index')->name('admin.sysmenugroup.index');
    Route::post('SysMenuGroup/create', 'SysMenuGroupController@create')->name('admin.sysmenugroup.create');
    Route::post('SysMenuGroup/update', 'SysMenuGroupController@update')->name('admin.sysmenugroup.update');
    Route::post('SysMenuGroup/destroy', 'SysMenuGroupController@destroy')->name('admin.sysmenugroup.destroy');
    //菜单管理
    Route::get('SysMenu/index', 'SysMenuController@index')->name('admin.sysmenu.index');
    Route::post('SysMenu/create', 'SysMenuController@save')->name('admin.sysmenu.create');
    Route::post('SysMenu/update', 'SysMenuController@save')->name('admin.sysmenu.update');
    Route::post('SysMenu/destroy', 'SysMenuController@destroy')->name('admin.sysmenu.destroy');
    //权限管理
    Route::get('SysPermission/index','SysPermissionController@index')->name('admin.syspermission.index');
    Route::get('SysPermission/getJsTreeData', 'SysPermissionController@getJsTreeData')->name('admin.syspermission.getjstreedata');
    Route::get('SysPermission/getTreeOption', 'SysPermissionController@getTreeOption')->name('admin.syspermission.gettreeoption');
    Route::get('SysPermission/get', 'SysPermissionController@get')->name('admin.syspermission.get');
    Route::post('SysPermission/save', 'SysPermissionController@save')->name('admin.syspermission.save');
    Route::post('SysPermission/saveSort', 'SysPermissionController@saveSort')->name('admin.syspermission.savesort');
    Route::post('SysPermission/destroy', 'SysPermissionController@destroy')->name('admin.syspermission.destroy');
    //系统角色管理
    Route::get('SysRole/index', 'SysRoleController@index')->name('admin.sysrole.index');
    Route::post('SysRole/create', 'SysRoleController@save')->name('admin.sysrole.create');
    Route::post('SysRole/update', 'SysRoleController@save')->name('admin.sysrole.update');
    Route::post('SysRole/savePerm', 'SysRoleController@savePermission')->name('admin.sysrole.saveperm');
    Route::post('SysRole/destroy', 'SysRoleController@destroy')->name('admin.sysrole.destroy');
    //系统用户管理
    Route::get('SysUser/index', 'SysUserController@index')->name('admin.sysuser.index');
    Route::post('SysUser/create', 'SysUserController@save')->name('admin.sysuser.create');
    Route::post('SysUser/update', 'SysUserController@save')->name('admin.sysuser.update');
    Route::post('SysUser/editRole', 'SysUserController@editRole')->name('admin.sysuser.editrole');
    Route::post('SysUser/changestatus', 'SysUserController@changeStatus')->name('admin.sysuser.changestatus');
    //系统文件管理
    Route::get('SysFile/index', 'SysFileController@index')->name('admin.sysfile.index');
    Route::match(['get', 'post'], 'SysFile/ueditorUpload', 'SysFileController@ueditorUpload')->name('admin.sysfile.ueditorupload');
    Route::post('SysFile/webUpload', 'SysFileController@webUpload')->name('admin.sysfile.webupload');
});


//认证
Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
